/*    */ package com.zimbra.cs.account.ldap.entry;
/*    */ 
/*    */ import com.zimbra.common.service.ServiceException;
/*    */ import com.zimbra.cs.account.Domain;
/*    */ import com.zimbra.cs.account.Provisioning;
/*    */ import com.zimbra.cs.account.ldap.LdapDIT;
/*    */ import com.zimbra.cs.account.ldap.LdapProv;
/*    */ import com.zimbra.cs.gal.ZimbraGalSearchBase.PredefinedSearchBase;
/*    */ import com.zimbra.cs.ldap.LdapException;
/*    */ import com.zimbra.cs.ldap.ZAttributes;
/*    */ import com.zimbra.cs.ldap.ZLdapFilter;
/*    */ import com.zimbra.cs.ldap.ZLdapFilterFactory;
/*    */ import java.util.Map;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ public class LdapDomain
/*    */   extends Domain
/*    */   implements LdapEntry
/*    */ {
/*    */   private String mDn;
/*    */   
/*    */   public LdapDomain(String dn, ZAttributes attrs, Map<String, Object> defaults, Provisioning prov)
/*    */     throws LdapException
/*    */   {
/* 43 */     super(attrs.getAttrString("zimbraDomainName"), attrs.getAttrString("zimbraId"), attrs.getAttrs(), defaults, prov);
/*    */     
/*    */ 
/* 46 */     this.mDn = dn;
/*    */   }
/*    */   
/*    */   public String getDN() {
/* 50 */     return this.mDn;
/*    */   }
/*    */   
/*    */   public String getGalSearchBase(String searchBaseRaw) throws ServiceException
/*    */   {
/* 55 */     LdapProv ldapProv = (LdapProv)getProvisioning();
/*    */     
/* 57 */     if (searchBaseRaw.equalsIgnoreCase(ZimbraGalSearchBase.PredefinedSearchBase.DOMAIN.name()))
/*    */     {
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/* 67 */       return getDN();
/*    */     }
/* 69 */     if (searchBaseRaw.equalsIgnoreCase(ZimbraGalSearchBase.PredefinedSearchBase.SUBDOMAINS.name()))
/* 70 */       return getDN();
/* 71 */     if (searchBaseRaw.equalsIgnoreCase(ZimbraGalSearchBase.PredefinedSearchBase.ROOT.name())) {
/* 72 */       return "";
/*    */     }
/*    */     
/*    */ 
/* 76 */     return searchBaseRaw;
/*    */   }
/*    */   
/*    */   public ZLdapFilter getDnSubtreeMatchFilter() throws ServiceException {
/* 80 */     LdapProv ldapProv = (LdapProv)getProvisioning();
/*    */     
/* 82 */     return ZLdapFilterFactory.getInstance().dnSubtreeMatch(new String[] { ldapProv.getDIT().domainDNToAccountSearchDN(getDN()), ldapProv.getDIT().domainDNToDynamicGroupsBaseDN(getDN()) });
/*    */   }
/*    */ }


/* Location:              /home/mint/zimbrastore.jar!/com/zimbra/cs/account/ldap/entry/LdapDomain.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       0.7.1
 */